export default class ServiceUtil{
    constructor(viewer){
        this.viewer =viewer;
    }
    getWMTS(option){
        if(option.rec){
            let recArray =option.rec.split(";");
        let rec =new Cesium.Rectangle(recArray[0] * Math.PI/180, recArray[1] * Math.PI/180, recArray[2] * Math.PI/180, recArray[3   ] * Math.PI/180);
        let wmtsProvider =new Cesium.WebMapTileServiceImageryProvider({
            url:option.url,
            layer: option.layer,
            style:'',
            format:'image/png',
            tileMatrixSetID:'EPSG:4326',
            tileMatrixLabels: [
                'EPSG:4326:0', 'EPSG:4326:1', 'EPSG:4326:2', 'EPSG:4326:3', 'EPSG:4326:4',
                'EPSG:4326:5', 'EPSG:4326:6', 'EPSG:4326:7', 'EPSG:4326:8', 'EPSG:4326:9',
                'EPSG:4326:10', 'EPSG:4326:11', 'EPSG:4326:12', 'EPSG:4326:13', 'EPSG:4326:14',
                'EPSG:4326:15', 'EPSG:4326:16', 'EPSG:4326:17', 'EPSG:4326:18', 'EPSG:4326:19',
                'EPSG:4326:20', 'EPSG:4326:21'],
            tilingScheme: new Cesium.GeographicTilingScheme({
                numberOfLevelZeroTilesX: 2,
                numberOfLevelZeroTilesY: 1
            }),
            minimumLevel:1,
            maximumLevel:15,
            rectangle: rec
        });
        this.viewer.imageryLayers.addImageryProvider(wmtsProvider);
        this.viewer.camera.flyTo({destination:rec});
    }
}
}